home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Source / Resound / InfoManager.m < prev    next >
Encoding:
Text File  |  1992-04-02  |  1.1 KB  |  51 lines

  1.  
  2. #import "InfoManager.h"
  3. #import "Imports.h"
  4.  
  5. @implementation InfoManager
  6.  
  7. - NoWindow
  8. {
  9.     [SoundType setStringValue:""];
  10.     [Samples setIntValue:0];
  11.     [Seconds setIntValue:0];
  12.     [Channels setIntValue:0];
  13.     [Fragmented setStringValue:""];
  14.     return self;
  15. }
  16.  
  17. - ChangeInfo:ThisSound
  18. {
  19.     int dataform;
  20.     [Channels setIntValue:[ThisSound channelCount]];
  21.     [Samples setIntValue:[ThisSound sampleCount]];
  22.     if ([ThisSound sampleCount]==0)
  23.         {[Seconds setFloatValue:0.0];}
  24.     else
  25.         {
  26.         [Seconds setFloatValue:(float) 
  27.             (((double)[ThisSound sampleCount])/[ThisSound samplingRate])];
  28.         }
  29.     if ([ThisSound needsCompacting])
  30.         {[Fragmented setStringValue:"FRAGMENTED"];}
  31.     else
  32.         {[Fragmented setStringValue:""];}
  33.     dataform=[ThisSound dataFormat];
  34.     if (dataform==SND_FORMAT_MULAW_8)
  35.         {[SoundType setStringValue:"8-Bit Mu-Law"];}
  36.     else 
  37.         {if (dataform==SND_FORMAT_LINEAR_16)
  38.             {if ([ThisSound samplingRate]==SND_RATE_LOW)
  39.                 {[SoundType setStringValue:"16-Bit 22 KhZ"];}
  40.              else
  41.                  {[SoundType setStringValue:"16-Bit 44 KhZ"];}
  42.             }
  43.          else
  44.              {[SoundType setStringValue:"Unknown"];}
  45.         }
  46.     return self;
  47. }
  48.  
  49.  
  50. @end
  51.